package com.hxm.appGenealogy.controller;

import com.hxm.appGenealogy.entity.*;
import com.hxm.appGenealogy.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@CrossOrigin
@RestController
@RequestMapping("app/comment")
public class CommentController {

    @Autowired
    private CommentService commentService;

    //添加评论;
    @PostMapping("insert")
    public ResponDataVo insertComment(@RequestBody Comment comment) {
        System.out.println("测试合并数据");
        return commentService.insertComment(comment);
    }

    //根据文章分页查询评论;
    @PostMapping("commentList")
    public ResponDataVo commentList(@RequestBody DynamicVo dynamic) {
        System.out.println("心情很好,感觉很妙;");
        return commentService.commentList(dynamic);
    }


}
